<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="../../plugins/layui/css/layui.css" />
		<link href="../../kitAdmin/css/app.css" rel="stylesheet" type="text/css" />
		<link rel="stylesheet" type="text/css" href="../../plugins/select2/dist/css/select2.min.css"/>
		<style type="text/css">
			.layui-unselect.layui-form-select {
			    display: none;
			}
		</style>
	</head>

	<body>
		<div style="margin: 10px">
			<label>选择状态：</label>
			<select lay-filter="_stateSelect" data-link='{:state}' id='_stateSelect' name='stateSelect' class='layui-input'>
<!-- 				<option value='all' selected="true">全部状态</option> -->
			</select>
		</div>
		<script src="../../common/js/jquery.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../static/js/base.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../plugins/jsviews/jsviews.js" type="text/javascript"></script>
		<script src="../../plugins/layui/layui.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../plugins/select2/dist/js/select2.min.js" type="text/javascript" charset="utf-8"></script>
		
		
		<script type="text/javascript">
		var uid = getQueryVariable('orderId');
		jQuery(document).ready(function() {
			bindStateSelect2();
			bindFormData();
		})
		
		// 2018-9-25 chenbin: 新增
		function bindFormData(){
			if(uid){
				$.ajax({
					url:baseUrl+'/freeAuditions/'+uid,
					type:'get',
					success:function(data){
						var state = data.data.state;
						if (state != null && state != '') {
							$.link(true, "#_stateSelect", data.data);
							$("#_stateSelect").select().trigger('change');
						}
					},
					error:function(){
						parent.layer.alert('数据加载失败，系统或网络错误！');
					}
				});
			}
		}
		
		function bindStateSelect2() {
			var fuzerenData = [
				{
					id : '待跟进',
					text : '待跟进'
				},
				{
					id : '跟进中',
					text : '跟进中'
				},
				{
					id : '完成',
					text : '完成'
				},
				{
					id : '失联',
					text : '失联'
				}
			];
			$('#_stateSelect').select2({
				placeholder: '请选择状态',
				allowClear: true,
				data: fuzerenData
			});
		}
		var callback_save=function(){
			if (!$('#_stateSelect').val()) {
				alert("请选择状态");
			} else {
				return $('#_stateSelect').val();
			}
		}
		</script>
	</body>
	

</html>
